<?php 

include './functions.php';

//载入数据库
$date = include './date.php';
//获得下标
$id = (int)$_GET['id'];
//获得旧内容
$oldDate = $date[$id];
//完成修改
if(IS_POST){
	//所谓的修改，就是覆盖原来的
	$date[$id] = $_POST;
	//写入数据库
	date_to_file($date, './date.php');	
	success('修改成功', './message.php');
}




 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
 	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 	<title>Document</title>
 	<style type="text/css">
 		*{padding:0px; margin:0px;}
		a{text-decoration: none;}
		ul,ol,li{list-style:none;}
		img{border:none;}
body{
	background:#EEE6D1;
}
form.nr{
    width:974px;
    height:380px;
    margin:0 auto;
    margin-top:100px;
    border:3px solid #EEE6D1;
}
 form.nr div.left{
    width:150px;
    height:380px;
    border-right:1px solid #EEE6D1;
    position:relative;
    float:left;
}
form.nr div.left img.tx{
    width:80px;
    height:80px;
    position:absolute;
    top:20px;
    left:35px;
    border-radius: 30px;
}
form.nr div.left p.nicheng{
	position:absolute;
    top:110px;
    left:10px;
    
}
form.nr div.left input.nc{
    height:20px;
    width:120px;
    position:absolute;
    top:130px;
    left:10px;
    color:#333;
}
form.nr div.middle{
    width:821px;
    height:180px; 
    float:left; 
    position:relative; 
}
form.nr div.middle input.bt{
    width:300px;
    margin-left:20px;
    height:30px;
    border:1px solid #5E3837;
    line-height:33px;
    text-indent:10px;
    color:#333;
}
form.nr div.middle p.neirong{
	position:absolute;
	top:50px;
	left:0px;
}
form.nr div.middle textarea.ly{
    text-indent:10px;
    color:#333;
    position:absolute;
    width:600px;
    height:100px;
    top:50px;
    left:65px;
}

form.nr div.middle input.xiugai{
	width:50px;
	height:30px;
	position:absolute;
	left:700px;
	bottom:0px;
	
}
form.nr div.middle div.bqb{
	position:absolute;
	top:150px;
	left:20px;
}
		
 	</style>
 	
 	
 	
 	
 </head>
 <body>
<!-- <!--	<!--
 	<form action="" method="post">
 		昵称：<input type="text" name="nickname" id="" value="<?php echo $oldDate['nickname'] ?>"/>
 		<br />
 		内容：<textarea name="content"><?php echo $oldDate['content']; ?></textarea>
 		<br />
 		<input type="submit" value="修改"/>
 	</form>-->
 	
 				<form class="nr" method="post">
					<div class="left">
						<img src="images/tx<?php echo $oldDate['photo'] ?>" alt="" class="tx"/>
						<p class="nicheng">昵称：</p>
						<input type="text" name="nickname" class="nc" value="<?php echo $oldDate['nickname'] ?>"/>
					</div>
					<div class="middle">
						主题：<input type="text" name="them" class="bt" value="<?php echo $oldDate['them'] ?>"/>
					<p class="neirong">内容：</p>	
					<textarea name="content" class="ly"><?php echo $oldDate['content']; ?></textarea>
					<input type="text" name="time" value="<?php echo date("Y-m-d H:i:s"); ?>" style="display:none;"/>
					
					<div class="bqb">
						<p style="height:103px; line-height:7em;">选择头像</p>
						<input type="radio" name="photo" value="1.jpg" checked="checked" class="photo"/>
						<img src="images/tx1.jpg" alt="" class="tp"/>
						<input type="radio" name="photo" value="2.jpg" class="photo"/>
						<img src="images/tx2.jpg" alt="" class="tp"/>
						<input type="radio" name="photo" value="3.jpg" class="photo"/>
						<img src="images/tx3.jpg" alt="" class="tp"/>
						<input type="radio" name="photo" value="4.jpg" class="photo"/>
						<img src="images/tx4.jpg" alt="" class="tp"/>
						<input type="radio" name="photo" value="5.jpg" class="photo"/>
						<img src="images/tx5.jpg" alt="" class="tp"/>
						<input type="radio" name="photo" value="6.jpg" class="photo"/>
						<img src="images/tx6.jpg" alt="" class="tp"/>
						
					</div>
					
					
						
						<input type="submit" value="修改" class="xiugai"/>
					</div>
				</form>
 	
 	
 	
 </body>
 </html>